package com.mth480.rebasedownloader;

import com.biomatters.geneious.publicapi.documents.*;
import com.biomatters.geneious.publicapi.plugin.*;
import com.biomatters.geneious.publicapi.documents.Condition;
import java.util.*;
import com.biomatters.geneious.publicapi.databaseservice.*;

/*
 * @Author: Nick LaVigne, Jake Almer
 * This class is going to create the fields used
 * for display and searching
 */
public class RebaseFields {

	public static List<DocumentField> displayFields;
	public static QueryField[] searchFields;
	
	public static void init()
	{
		displayFields = new ArrayList<DocumentField>();
		
		DocumentField enNameDF = DocumentField.createStringField(
				"Enzyme Name", 
				"Name of the Enzyme",
				"RE1");
		displayFields.add(enNameDF);
		DocumentField pDF = DocumentField.createStringField(
				"Prototype", 
				"Enzyme's Prototype", 
				"RE2");
		displayFields.add(pDF);
		DocumentField mDF = DocumentField.createStringField(
				"Microorganism", 
				"Microorganism", 
				"RE3");
		displayFields.add(mDF);
		DocumentField msDF = DocumentField.createStringField(
				"Meth Site/Type",
				"Meth Site/Type",
				"RE4");
		displayFields.add(msDF);
		DocumentField csDF = DocumentField.createStringField(
				"Commercial Source", 
				"Company providing the Restriction Enzyme",
				"RE5");
		displayFields.add(csDF);
		
		// create the query fields
		searchFields = new QueryField[5];
		
		Condition[] sCond = {Condition.CONTAINS};
		// Enzyme Name
		QueryField enzymeName = new QueryField(
				enNameDF, sCond);
		
		// Prototype
		QueryField prototype = new QueryField(
				pDF, sCond);
		
		// Microorganism
		QueryField microorganism = new QueryField(
				mDF, sCond);
		
		// Microorganism source
		
		QueryField methSite = new QueryField(
				msDF, sCond);
		
		// Commercial Source
		QueryField cSource = new QueryField(
				csDF, sCond);
		
		// add all of them to the "search fields"
		searchFields[0] = enzymeName;
		searchFields[1] = prototype;
		searchFields[2] = microorganism;
		searchFields[3] = methSite;
		searchFields[4] = cSource;
		
		
		
		
	
	}
	
	
}
